import { isPhoneNumber } from '@/utils/index'

export const formRules = {
  name: [{ required: true, validator: notEmpty, msg: '请输入会议名称', trigger: ['blur', 'change'] }],
  code: [{ required: true, validator: notEmpty, msg: '请输入会议编号', trigger: ['blur', 'change'] }],
  type: [{ required: true, validator: notEmpty, msg: '请选择会议类型', trigger: ['blur', 'change'] }],
  address: [{ required: true, validator: notEmpty, msg: '请输入会议地点', trigger: ['blur', 'change'] }],
  number: [{ required: true, validator: notEmpty, msg: '请输入会议人数', trigger: ['blur', 'change'] }],
  leaderId: [{ required: true, validator: notEmpty, msg: '请选择会议负责人', trigger: ['blur', 'change'] }],
  departmentId: [{ required: true, validator: notEmpty, msg: '请选择会议部门', trigger: ['blur', 'change'] }],
  meetingTime: [{ required: true, validator: notEmpty, msg: '请选择会议时间', trigger: ['blur', 'change'] }],
}



// 校验不能为空
function notEmpty(rule, value, callback) {
  console.log(value, '啥数据？？');
  if (!value) {
    
    return callback(new Error(rule.msg))
  }else{
    return callback()
  }
}



export const personalColumn = [
  { prop: 'name', label: '姓名', align: 'center', },
  { prop: 'phone', label: '联系电话', align: 'center'},
  { prop: 'position', label: '岗位', align: 'center'},
  { prop: 'departmentId', label: '所属部门', align: 'center'},
]